 (function() {

     angular.module('BlurAdmin.pages.console')
         .controller('consoleCtrl', consoleCtrl);

     function consoleCtrl($scope, $datepicker, $mydialog, $http, $myconfig) {

         $scope.mydata = "你好啊";
         //  $mydialog.warning('aaaaa是是是是是是是是是事实上事人人人人人');

         //日期插件
         $scope.dat = new Date();
         $scope.dat2 = new Date();


         $scope.format = "yyyy/MM/dd";
         $scope.altInputFormats = ['yyyy/M!/d!'];

         $scope.popup1 = {
             opened: false
         };
         $scope.popup2 = {
             opened: false
         };
         $scope.dat = {
             dat3: $datepicker.dataNew(),
             dat4: $datepicker.dataNew(),
         }

         $scope.open1 = function(val) {
             if (val == 1) {
                 $scope.popup1.opened = true;
             } else {
                 $scope.popup2.opened = true;
             }
         };



         //饼状图数据
         $scope.tpo = 1;
         $scope.myTabs = function(val) {
             $scope.tpo = val;
         }

         $http.get($myconfig.api.Physicallogs_data_statistics).then(function(res) {
             $scope.statistics_data = res.data.data;
             console.log($scope.statistics_data);
             var lastuser = res.data.data.lastuser ? res.data.data.lastuser : 1;
             var newuser = res.data.data.newuser ? res.data.data.newuser : 0;

             $scope.user_Proportion = ((newuser / lastuser) * 100).toFixed(2);

             var lastbind = res.data.data.lastbind ? res.data.data.lastbind : 1;
             var newbind = res.data.data.newbind ? res.data.data.newbind : 0;
             $scope.newbind = ((newbind / lastbind) * 100).toFixed(2);

         });




     }
 })();